package cn.anquing.demo.elasticsearch.config.es;

import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.data.elasticsearch.client.ClientConfiguration;
import org.springframework.data.elasticsearch.client.RestClients;
import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration;

/**
 * @author wangqq65
 * @since 2021/4/21 16:29
 */
public class RestClientConfig extends AbstractElasticsearchConfiguration  {

    /**
     * 使用
     */
    @Override
    @Bean
    public RestHighLevelClient elasticsearchClient() {
        return RestClients.create(ClientConfiguration.localhost()).rest();
    }

}
